
var AJAX = {};
var req;
var which;
var $result;
function retrieveURL(url, post) {
	if (window.XMLHttpRequest) { // Non-IE browsers
		req = new XMLHttpRequest();
		req.onreadystatechange = callback;
		try {
			req.open("OPEN", url, true);
			xmlHttpRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		}
		catch (e) {
			//alert(e);
		}
		req.send(post);
	} else {
		if (window.ActiveXObject) { // IE
			try {
				req = new ActiveXObject("Xsxml2.XMLHTTP");
			}
			catch (e) {
				try {
					req = new ActiveXObject("Microsoft.XMLHTTP");
				}
				catch (e) {
					//alert(e);
				}
			}
			req.onreadystatechange = callback;
			try {
				req.open("OPEN", url, true);
				xmlHttpRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
			}
			catch (e) {
				//alert(e);
			}
			req.send(post);
		}
	}
}
function callback(fdata) {
	if (fdata == undefined) {
		fdata = "";
	}
	if (req.readyState == 4) { // Complete
		if (req.status == 200) { // OK response
			$result = req.responseText;
//  alert("2: " +req.responseXML);
//   alert("3: " + req.statusText);
        //document.getElementById("pic").innerHTML = req.responseText;
		} else {
		//	alert("Problem: " + req.statusText);
		}
	}
}

